/**
 * Test file with function definitions and nested objects
 * to verify that only keys with dots are extracted as valid API names
 */

const usm = {
  'useSearch.find.pro.list': {
    url: '/subject/list',
    mockFn: () => {
      // This function contains object definitions that should be ignored
      return {
        "code": 0,           // Should be ignored (no dot)
        "msg": "",           // Should be ignored (no dot)
        "pageNo": 1,         // Should be ignored (no dot)
        "pageSize": 5,       // Should be ignored (no dot)
        "total": 20,         // Should be ignored (no dot)
        "data": generateUserList(20)  // Should be ignored (no dot)
      };
    },
    validate: function(data) {
      const config = {
        required: true,      // Should be ignored (no dot)
        minLength: 1,        // Should be ignored (no dot)
        maxLength: 100       // Should be ignored (no dot)
      };
      return config;
    }
  },
  'useSearch.command.validate': '/subject/validate'  // Should be extracted (has dot)
};

const sm = {
  'sm.find.pro.list': '/subject/list',        // Should be extracted (has dot)
  'sm.command.edit': '/subject/edit',         // Should be extracted (has dot)
  'sm.command.del.smitem': '/subject/delete/:subjectId',  // Should be extracted (has dot)
  
  // Function with nested object - the nested keys should be ignored
  processData: function(input) {
    const result = {
      success: true,       // Should be ignored (no dot)
      errors: [],          // Should be ignored (no dot)
      warnings: []         // Should be ignored (no dot)
    };
    return result;
  },
  
  'sm.command.merge': '/subject/merge',       // Should be extracted (has dot)
  'sm.find.treeById': '/subject/series/list/:subjectId',  // Should be extracted (has dot)
  
  // Arrow function with object return
  getConfig: () => ({
    timeout: 5000,         // Should be ignored (no dot)
    retries: 3,            // Should be ignored (no dot)
    baseURL: 'https://api.example.com'  // Should be ignored (no dot)
  }),
  
  'sm.command.list.total': '/subject/total'   // Should be extracted (has dot)
};

const file = {
  'file.find.pro.hList': '/file/history/list',     // Should be extracted (has dot)
  'file.command.add.upload': '/file/shard/upload', // Should be extracted (has dot)
  
  // Object method with nested definitions
  handleUpload: {
    prepare: function() {
      const options = {
        chunks: true,        // Should be ignored (no dot)
        concurrent: 3,       // Should be ignored (no dot)
        retryOnError: true   // Should be ignored (no dot)
      };
      return options;
    },
    execute: () => {
      // More nested objects that should be ignored
      const state = {
        progress: 0,         // Should be ignored (no dot)
        status: 'pending',   // Should be ignored (no dot)
        errors: null         // Should be ignored (no dot)
      };
      return state;
    }
  },
  
  'file.command.del.allItem': '/file/history/clean',  // Should be extracted (has dot)
  'file.find.item.status': '/file/shard/upload/status'  // Should be extracted (has dot)
};

// Function that returns an object (should be completely ignored)
function createApiConfig() {
  return {
    host: 'localhost',     // Should be ignored (no dot)
    port: 3000,            // Should be ignored (no dot)
    protocol: 'http'       // Should be ignored (no dot)
  };
}

// Object with mixed valid and invalid keys
const project = {
  'project.find.pro.list': '/project/list',   // Should be extracted (has dot)
  
  // Invalid keys (no dots) - should be ignored
  version: '1.0.0',         // Should be ignored (no dot)
  name: 'test-project',     // Should be ignored (no dot)
  
  'project.command.add': '/project/add',      // Should be extracted (has dot)
  'project.command.edit': '/project/edit',    // Should be extracted (has dot)
  
  // Function property with object return
  getMetadata: function() {
    return {
      author: 'developer',   // Should be ignored (no dot)
      license: 'MIT',        // Should be ignored (no dot)
      repository: 'github.com/example/repo'  // Should be ignored (no dot)
    };
  },
  
  'project.command.del': '/project/delete/:id'  // Should be extracted (has dot)
};

export default {
  ...usm,
  ...sm,
  ...file,
  ...project
};